#ifndef _REGULARSOLDIERLIVING_H_
#define _REGULARSOLDIERLIVING_H_

#include "ILiving.h"

#define START_HEALTH 15

/**
 * How RegularSoldier lives
 */
class RegularSoldierLiving : public ILiving
{
private:
  /**
   * Stores the object's health.
   */
  int health;

  /**
   * Function that will be called upon object's death.
   */
  ILiving::killCallbackFunction killFunc;

public:
  RegularSoldierLiving() : health(START_HEALTH) {}
  int getHealth() const { return health; }

  void setHealth(int h) { health = h; }

  void hurt(int i)
    {
       health -= i;
       if (health < 0)
         {
           killFunc(this);
         }
    }

  void heal(int i)
    {
      health += i;
    }

  void setKillCallback(ILiving::killCallbackFunction f) { killFunc = f; }
};
#endif /* _REGULARSOLDIERLIVING_H_ */

